import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)


const routes = [
    { path: '/', redirect: '/login'},
    { 
      path: '/login', 
      component:() => import('../views/login') 
    },
    {
      path:'/recommend',
      component:() => import('../views/recommend')
    },
    {
      path:'/carShop',
      component:() => import('../views/carShop')
    },
    {
      path:'/bigData',
      component:() => import('../views/bigData')
    },
    {
      path:'/lookCar',
      component:() => import('../views/lookCar')
    },
    { 
      path: '/index', 
      component:() => import('../views/index'), 
      redirect: '/index/banners',
      children: [
        { path: 'banners', component:() => import('../views/shouye/banner') },
        { path: 'category', component:() => import('../views/shouye/category') },
        { path: 'categoryEdit', component:() => import('../views/shouye/categoryEdit') },
        { path: 'recomend', component:() => import('../views/shouye/recomend') },
        { path: 'fenlei', component:() => import('../views/shangpin/fenlei') },
        { path: 'brand', component:() => import('../views/shangpin/brand') },
        { path: 'goods', component:() => import('../views/shangpin/goods') },
        { path: 'personproduct', component:() => import('../views/shangpin/personproduct') },
        { path: 'xinwen', component:() => import('../views/xinwen/xinwen') }
      ]
    },
  ]

const router = new VueRouter({
    routes, // `routes: routes` 的缩写
  })

  export default router